<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Lotto</title>
<link href="../css/member_global.css?t={ctime}" rel="stylesheet" type="text/css" />
<link href="../css/member_main_lot_all.css?t={ctime}" rel="stylesheet" type="text/css">
<link href="../css/member_main_lot_b5.css?t={ctime}" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
var sid = "{sid}";
var isSpecial = "{isSpecial}";
var RefreshSec = 20;
var intRefreshSec = 0;
var isRefresh = true;
var setIntervalID1 = 0, setIntervalID2 = 0;
var strEndGameTime = "{EndGameTime}";

function NumFormat(intNum){
	return (intNum < 10)?("0" + intNum.toString()):intNum.toString();
}

function GetWagerTable(){
	if(document.getElementById("OddsID1") && document.getElementById("OddsID49")){
		InsertOdds();
		return;
	}

	var objWTable = document.getElementById("wager_table"), i = 0, j = 0, intNum = 0, strNum = "", strDisabled = "";
	var ArrGame = eval("parent.Game"+isSpecial);

	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);
			
		for(i = 1; i <= 5; i++)	{
			newTR = insertRow(rows.length);
			newTR.className = (i % 2 == 1)?"mcen":"mcen_ev";
			with(newTR){
				var intCellNo = 0;
				for (j = 0; j <= 4; j++){
					intNum = 5*j + i;
					strNum = NumFormat(intNum);
										
					if (ArrGame[intNum] == null) {
						newTD = insertCell(intCellNo);
						newTD.colSpan = "2";
						newTD.className = "mbline";
						newTD.innerHTML = "&nbsp;";
						intCellNo++;
						continue;
					}else{
						newTD = insertCell(intCellNo);
						newTD.className = "mcen_ev_th";
						newTD.innerHTML = strNum;
						intCellNo++;
					}
					newTD = insertCell(intCellNo);
					newTD.className = "mbline_baratio";
					newTD.id = "OddsID"+intNum.toString();
					intCellNo++;
				}
			}
		}
	}
	InsertOdds();
}

function InsertOdds(){
	var ArrGame = eval("parent.Game"+isSpecial);
	var newTD, intNum = 0;

	for(i =1; i <= 5; i++)	{
		for (j = 0; j <= 4; j++){
			intNum = 5*j + i;
			newTD = document.getElementById("OddsID"+intNum.toString());
			if (ArrGame[intNum] == null) {
				//newTD.className = "mbline";
				continue;
			}else if(ArrGame[intNum][6] == "1"){
				newTD.className = "mbline_baratio_stop";
			}else{
				newTD.className = "mbline_baratio";
			}
			newTD.innerHTML = "<a href=\"wager_common.php?UserID="+parent.strUserID+"&GambleID="+ArrGame[intNum][1]+"&Bet_Type="+ArrGame[intNum][2]+"&OddsID="+ArrGame[intNum][4]+"&Odds="+ArrGame[intNum][5]+"&LottoID="+ArrGame[intNum][0]+"&Number="+intNum.toString()+"&sid="+sid+"\" target=\"leftFrame\" id=\"OddsTip1_"+intNum.toString()+"\">"+ArrGame[intNum][5]+"</a>";
		}
	}
}

function CountRefresh(){
	var Digital=new Date(), strDate2 = "", arrD1 = new Array(), arrD2 = new Array(), intGT = 0, intGT2 = 0, strGTm = "", strGTs = "";
	with(Digital){
		strDate2 = getFullYear().toString() + "-" + (getMonth() + 1 < 10?"0":"") + (getMonth() + 1).toString() + "-" + (getDate() < 10?"0":"") + getDate().toString() + " " + getHours().toString() + ":" + getMinutes().toString() + ":" + getSeconds().toString();
	}
	arrD1 = strEndGameTime.split(" ");
	arrD2 = strDate2.split(" ");
	if(arrD2[1] > arrD1[1] && arrD1[0] == arrD2[0]){
		RefreshSec = 5;
	}

	if(intRefreshSec >= RefreshSec)isRefresh = true;
	intGT = parseInt(parent.strEndGameTime);
	if(intGT < 0)intGT = 0;
	intGT2 = (intGT > 900)?900:intGT;
	strGTm = (Math.floor(intGT2 / 60)).toString();
	if(strGTm.length < 2)strGTm = "0" + strGTm;
	strGTs = (intGT2 % 60).toString();
	if(strGTs.length < 2)strGTs = "0" + strGTs;
	document.getElementById("GameSec").innerHTML = strGTm+":"+strGTs;
	parent.strEndGameTime = intGT - 1;
	intRefreshSec++;
	//window.status = intRefreshSec;
}

function SubmitOddsForm(){
	if(isRefresh == false){
		document.GetOddsForm.action = "http://tw.i5.yimg.com/i/tw/hp/spirit/w5.gif";
		document.GetOddsForm.submit();
		window.status = "";
		return;
	}
	document.GetOddsForm.action = "10m1_odds.php";
	document.GetOddsForm.submit();
	isRefresh = false;
	intRefreshSec = 0;
}

function DisplayWindow(){
	var i = 0;
	document.getElementById("score_window").style.display = parent.strDisplay;
	if(parent.strDisplay != "none"){
		for(var i = 0; i < parent.arrImages.length; i++){
			document.getElementById("image" + (i + 1)).src = "../images/lottery/ball/"+parent.arrImages[i]+".gif";
		}
	}
}

function InitAction(){
	document.GetOddsForm.submit();
	setIntervalID1 = setInterval("SubmitOddsForm();", 120000);
	setIntervalID2 = setInterval("CountRefresh();", 1000);
}
//-->
</script>
</head>

<body class="lb_body" onload="InitAction()" oncontextmenu="window.event.returnValue=false" ondragstart="window.event.returnValue=false" onselectstart="event.returnValue=false">
<!--Get Odds Form//-->
<form action="10m1_odds.php" target="hiddenTop" name="GetOddsForm">
	<input type="hidden" name="LottoID" value="{LottoID}">
	<input type="hidden" name="isSpecial" value="{isSpecial}">
	<input type="hidden" name="Bet_Type" value="{Bet_Type}">
	<input type="hidden" name="MSite" value="{MSite}">
	<input type="hidden" name="sType" value="o">
	<input type="hidden" name="sid" value="{sid}">
</form>
<!--Get Odds Form//-->

<!--樣式2-->
<div class="topStyle_2">
<!-- 期數 區塊 //-->
<table class="mtop" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td colspan="2" align="center">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td align="center" class="menu_title">{Title}</td>
			<td align="right" valign="top" class="mictxt">
				<table border="0" cellspacing="0" cellpadding="0" id="score_window" style="display:none">
					<tr>
					<td>{Normal}</td>
					<td id="NormalBall">
						<img src="../images/ball/00.gif" id="image1"><img src="../images/ball/00.gif" id="image2"><img src="../images/ball/00.gif" id="image3"><img src="../images/ball/00.gif" id="image4"><img src="../images/ball/00.gif" id="image5"><img src="../images/ball/00.gif" id="image6"></td>
					<td>{Special}</td>
					<td id="SpecialBall"><img src="../images/ball/00.gif" id="image7"></td>
					</tr>
				</table>
			</td>
			<td align="right" valign="top" class="mictxt">
				{GameNo}:<em id="GameNo">0</em>{GameTime}<em id="GameSec">15:00</em>({ChinaTime}<a id="ChinaTime">&nbsp;</a>)
				<input class="zabottonR" value="{Refresh}" type="button" onclick="SubmitOddsForm();" />
			</td>
		</tr>
		</table>
	</td>
</tr>
<!-- 期數 區塊 //-->
<!-- 期數 區塊 //-->
<tr class="menu_tab">
	<td width="69%" nowrap="nowrap" class="menu_tab" >
<!-- NormlSpecial Bar Start //-->
    <a href="{SelfFile}?stype=o&isSpecial=5&sid={sid}" id="NSBar1">{NSBar1}</a>
    <a href="{SelfFile}?stype=o&isSpecial=6&sid={sid}" id="NSBar2">{NSBar2}</a>
	<a href="{SelfFile}?stype=o&isSpecial=7&sid={sid}" id="NSBar3">{NSBar3}</a>
	<a href="{SelfFile}?stype=o&isSpecial=8&sid={sid}" id="NSBar4">{NSBar4}</a>
<!-- NormlSpecial Bar End //-->
<!-- SpecialNumber Bar Start //-->
	{SpecialNum}
<!-- SpecialNumber Bar End //-->
	</td>
	<td width="31%" valign="bottom" nowrap="nowrap" ><a href="{SelfFile}?stype=q&isSpecial={isSpecial}&Bet_Type={Bet_Type}&LottoID={LottoID}&sid={sid}" target="leftFrame"><img src="../images/lottery/mode_1.jpg" width="75" height="19" alt="{QuickType}" /></a><a href="{SelfFile}?stype=c&isSpecial={isSpecial}&sid={sid}"><img src="../images/lottery/mode_2.jpg" width="75" height="19" alt="{CommonType}" /></a><a href="{SelfFile}?stype=o&isSpecial={isSpecial}&sid={sid}"><img src="../images/lottery/mode_3.jpg" width="75" height="19" alt="{OddsType}" /></a></td>
</tr>
</table>
</div>

<table border="0" cellpadding="0" cellspacing="0" width="725">
<tr>
	<td width="100%" align="left" valign="top">
<!-- 號碼 區塊 //-->
<table class="mbtab" width="100%" border="0" cellpadding="0" cellspacing="0" id="wager_table">
<tbody><tr class="mbtitle">
	<td width="9%">{Number}</td>
	<td width="11%">{Odds}</td>
	<td width="9%">{Number}</td>
	<td width="11%">{Odds}</td>
	<td width="9%">{Number}</td>
	<td width="11%">{Odds}</td>
	<td width="9%">{Number}</td>
	<td width="11%">{Odds}</td>
	<td width="9%">{Number}</td>
	<td width="11%">{Odds}</td>
</tr>
</tbody></table>
<!-- 號碼 區塊 //-->
	</td>

<!--No Number Start//-->
	<td width="150" align="right" valign="top">
		<table class="mbtab_raaline" width="110" border="0" cellpadding="0" cellspacing="0">
		<tbody><tr class="mbtitle">
			<td colspan="2">其他投注</td>
		</tr>
		<tr class="mcen">
			<th width="50">{SpecialOdd}</th>
			<td class="mbline_baratio" width="60" id="OddsTD2_0"><a href="JavaScript:void(0)" target="leftFrame" id="OddsTip2_0">0.00</a></td>
		</tr>
		<tr class="mcen">
			<th>{SpecialEven}</th>
			<td class="mbline_baratio" id="OddsTD2_1"><a href="JavaScript:void(0)" target="leftFrame" id="OddsTip2_1">0.00</a></td>
		</tr>
		<tr class="mcen">
			<th>{SpecialOver}</th>
			<td class="mbline_baratio" id="OddsTD3_0"><a href="JavaScript:void(0)" target="leftFrame" id="OddsTip3_0">0.00</a></td>
		</tr>
		<tr class="mcen">
			<th>{SpecialUnder}</th>
			<td class="mbline_baratio" id="OddsTD3_1"><a href="JavaScript:void(0)" target="leftFrame" id="OddsTip3_1">0.00</a></td>
		</tr>
		<!--@ SumOddEven Start @//-->
		<tr class="mcen">
			<th>{SumOdd}</th>
			<td class="mbline_baratio" id="OddsTD4_0"><a href="JavaScript:void(0)" target="leftFrame" id="OddsTip4_0">0.00</a></td>
		</tr>
		<tr class="mcen">
			<th>{SumEven}</th>
			<td class="mbline_baratio" id="OddsTD4_1"><a href="JavaScript:void(0)" target="leftFrame" id="OddsTip4_1">0.00</a></td>
		</tr>
		<!--@ SumOddEven End @//-->
		</tbody></table>
	<td>
<!--No Number End//-->
</tr>
</table>

</body>
</html>